From 06d042bf93d2ebf5a615963db981adb563959518 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Thu, 17 Jul 2003 21:51:13 +0000 Subject: [PATCH] bitkeeper revision 1.363 (3f171a51lxF2ZLdi2G16l31zvS1aNQ) xen_kbd.c, schedule.c, network.c: More cleanups. --- xen/common/network.c | 5 ++++- xen/common/schedule.c | 9 ++++----- xen/drivers/char/xen_kbd.c | 19 ++++++++++++++----- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/xen/common/network.c b/xen/common/network.c index f8526c1854..5a8fd56474 100644 --- a/xen/common/network.c +++ b/xen/common/network.c @@ -259,8 +259,11 @@ int vif_getinfo(vif_getinfo_t *info) vif = p->net_vif_list[info->vif]; - if(vif == NULL) + if ( vif == NULL ) + { + put_task_struct(p); return -ENOSYS; + } info->total_bytes_sent = vif->total_bytes_sent; info->total_bytes_received = vif->total_bytes_received; diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 900728175f..680e885923 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -225,14 +225,15 @@ long sched_adjdom(int dom, unsigned long mcu_adv, unsigned long warp, dom, mcu_adv, warp, warpl, warpu); p = find_domain_by_id(dom); - if ( p == NULL ) return -ESRCH; + if ( p == NULL ) + return -ESRCH; spin_lock_irq(&schedule_data[p->processor].lock); - p->mcu_advance = mcu_adv; - spin_unlock_irq(&schedule_data[p->processor].lock); + put_task_struct(p); + return 0; } @@ -569,11 +570,9 @@ void __init scheduler_init(void) void schedulers_start(void) { printk("Start schedulers\n"); - __cli(); sched_timer(0); virt_timer(0); smp_call_function((void *)sched_timer, NULL, 1, 1); - __sti(); } diff --git a/xen/drivers/char/xen_kbd.c b/xen/drivers/char/xen_kbd.c index 0190055a33..782e481c05 100644 --- a/xen/drivers/char/xen_kbd.c +++ b/xen/drivers/char/xen_kbd.c @@ -185,12 +185,13 @@ static void keyboard_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned char status, scancode; unsigned int work = 1000; - unsigned long cpu_mask, flags; + unsigned long cpu_mask = 0, flags; + struct task_struct *p = CONSOLE_OWNER; spin_lock_irqsave(&kbd_lock, flags); while ( (--work > 0) && ((status = kbd_read_status()) & KBD_STAT_OBF) ) - { + { scancode = kbd_read_input(); #ifdef CONFIG_XEN_ATTENTION_KEY @@ -214,15 +215,23 @@ static void keyboard_interrupt(int irq, void *dev_id, struct pt_regs *regs) } #endif - kbd_ring_push(status, scancode); - cpu_mask = mark_guest_event(CONSOLE_OWNER, _EVENT_KBD); - guest_event_notify(cpu_mask); + if ( p != NULL ) + { + kbd_ring_push(status, scancode); + cpu_mask |= mark_guest_event(CONSOLE_OWNER, _EVENT_KBD); + } } if ( !work ) printk(KERN_ERR "xen_keyb: controller jammed (0x%02X).\n", status); spin_unlock_irqrestore(&kbd_lock, flags); + + if ( p != NULL ) + { + put_task_struct(p); + guest_event_notify(cpu_mask); + } } -- 2.30.2